/**
 * @copyright   2010-2017, The Titon Project
 * @license     http://opensource.org/licenses/BSD-3-Clause
 * @link        http://titon.io
 */

@include export("divider") {
    #{generate-class-name($titon-divider)} {
        text-align: center;
        overflow: hidden;

        &::before,
        &::after {
            @extend %placeholder-inline-block;
            content: "";
            width: 100%;
            border-top: 1px solid black(.1);
            border-bottom: 1px solid white(.75);
        }

        &::before {
            margin-#{bidi-alignment()}: -100%;
            #{bidi-alignment()}: -#{theme-setting("margin")};
        }

        &::after {
            margin-#{bidi-opposite-alignment()}: -100%;
            #{bidi-opposite-alignment()}: -#{theme-setting("margin")};
        }

        // Collapse the middle when there is no content
        &:empty {
            &::before,
            &::after {
                right: 0;
                left: 0;
            }
        }

        > span {
            display: inline-block;
            vertical-align: middle;
        }
    }
}
